package com.spring.framework.config.async.xml;

import com.spring.framework.model.learn.ReflectWarning;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * 异步事件
 *
 * @author xuweizhi
 */
@EnableAsync
@Configuration
@SuppressWarnings("all")
@ComponentScan(basePackages = {"com.spring.framework.config.event"})
public class AsyncMainStart extends ReflectWarning {

	public static class xmlTaskExecutorTest {

		public static void main(String[] args) {
			ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("config/sync/spring-async.xml");
			AsyncMethod asyncMethod = ac.getBean(AsyncMethod.class);
			System.out.println(asyncMethod.getClass());
			System.out.println("--------" + Thread.currentThread().getName() + "--------");
			asyncMethod.log();
			asyncMethod.log2();
		}

	}


}
